<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>MOOC oriented Data Analysis System - ProblemLog</title>
    <meta content="" name="descriptison">
    <meta content="" name="keywords">


    <!-- 引入刚刚下载的 ECharts 文件 -->
    <script src="static/assets/js/echarts.min.js"></script>
    <script src='static/assets/js/ecStat.min.js'></script>


    <!-- Favicons -->
    <link href="static/assets/img/favicon.png" rel="icon">
    <link href="static/assets/img/apple-touch-icon.png" rel="apple-touch-icon">

    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i,900"
          rel="stylesheet">

    <!-- Vendor CSS Files -->
    <link href="static/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="static/assets/vendor/icofont/icofont.min.css" rel="stylesheet">
    <link href="static/assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
    <link href="static/assets/vendor/animate.css/animate.min.css" rel="stylesheet">
    <link href="static/assets/vendor/venobox/venobox.css" rel="stylesheet">
    <link href="static/assets/vendor/aos/aos.css" rel="stylesheet">

    <!-- Template Main CSS File -->
    <link href="static/assets/css/style.css" rel="stylesheet">

    <!-- =======================================================
    * Template Name: Mamba - v2.0.1
    * Template URL: https://bootstrapmade.com/mamba-one-page-bootstrap-template-free/
    * Author: BootstrapMade.com
    * License: https://bootstrapmade.com/license/
    ======================================================== -->
</head>

<body>
<!-- ======= Header ======= -->
<header id="header">
    <div class="container">

        <div class="logo float-left">
            <h1 class="text-light"><a href="index.html"><span>MOOC</span></a></h1>
            <!-- Uncomment below if you prefer to use an image logo -->
            <!-- <a href="index.html"><img src="static/assets/img/logo.png" alt="" class="img-fluid"></a>-->
        </div>

        <nav class="nav-menu float-right d-none d-lg-block">
            <ul>
                <li><a href="/index" style="font-size: 24px">首页</a></li>
                <li><a href="/exercise" style="font-size: 24px">练习</a></li>
                <li  class="active"><a href="/problemlogs" style="font-size: 24px">日志</a></li>
                <li><a href="/recommend" style="font-size: 24px">应用</a></li>
            </ul>
        </nav><!-- .nav-menu -->

    </div>
</header><!-- End Header -->

<!-- ======= Our Team Section ======= -->
<section id="team" class="team font-color">

    <div class="container">

        <div class="section-title">
            <h2>problemlog基本信息</h2>
        </div>

        <section class="counts section-bg">
            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div id="exercise_num_most_top20_students">
                <span style="font-size: 18px">哪些人做题数最多</span>
                <button id="btn1" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation1" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：横轴为学生的账号id，纵轴为学生的做题数量，本条形统计图统计做题数前20名的学生。从图中可以看到，学号为88703的学生做题数量最多，为98道。</p>
                </div>
                <div id="main" style="width: 100%;height:400px;"></div>
            </div>
            <br><br>

            <div id="num_points_relation">
                <span style="font-size: 18px">获得积分与做题数量有什么关系呢</span>
                <button id="btn2" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation2" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：横轴为学生的做题数，纵轴为学生的获得积分，本散点图研究数量关系。从图中可以看到获得积分和做题数量成正比，这是符合我们的常识的，练习可以使得学生成绩进步。
                        但我们也能看到部分学生的积分随做题数量的走势是分为了几类（接下来我们会对学生对象按这两个指标进行聚类分析，进一步探寻相关规律），
                        极个别学生的情况较为特殊， 如图中的离散点。</p>
                </div>
                <div id="main2" style="width: 100%;height:400px;"></div>
            </div>
            <br><br>

            <div id="num_points_cluster">
                <span style="font-size: 18px">聚类分析学生做题获得积分数和做题数量的关系</span>
                <button id="btn3" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation3" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：聚类分析将所有学生划分为三类，分别为优秀生、中等生、差生，从而帮助老师区分不同学生的学习情况，因材施教。比如：对差生
                        可以重点关注，补短板，提成绩；对优生可以安排一些高难度题目，拔高训练；对中等生可以安排稍难一点的题目，进行强化训练。</p>
                </div>
                <img src="static/assets/img/聚类分析学生做题获得积分数和做题数量的关系.jpg">
            </div>
            <br><br>

            <div id="num_rate_relation">
                <span style="font-size: 18px">做题正确率与做题数量有什么关系呢</span>
                <button id="btn2-2" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation2-2" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：横轴为学生的做题数，纵轴为学生的做题正确率，本散点图研究两者关系。从图中可以看到随着做题数量的增加，正确率先提升达到一定高度后保持稳定，这是符合我们的常识的，练习可以使得学生成绩进步。
                        但我们也能看到部分学生的正确率随做题数量的走势是分为了几类（接下来我们会对学生对象按这两个指标进行聚类分析，进一步探寻相关规律），
                        极个别学生的情况较为特殊， 如图中的离散点。</p>
                </div>
                <div id="main5" style="width: 100%;height:400px;"></div>
            </div>
            <br><br>

            <div id="num_rate_cluster">
                <span style="font-size: 18px">聚类分析学生做题正确率和做题数量的关系</span>
                <button id="btn3-2" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation3-2" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：聚类分析将所有学生划分为三类，分别为优秀生、中等生、差生，从而帮助老师区分不同学生的学习情况，因材施教。比如：对差生
                        可以重点关注，补短板，提成绩；对优生可以安排一些高难度题目，拔高训练；对中等生可以安排稍难一点的题目，进行强化训练。</p>
                </div>
                <img src="static/assets/img/聚类分析学生做题正确率和做题数量的关系.jpg">
            </div>
            <br><br>

            <div id="prefer_exercise_type">
                <span style="font-size: 18px">最受学生喜欢的题目类型</span>
                <button id="btn4" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation4" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：从下图可以看出学生最喜欢的练习领域为arithmetic、话题为-addition-subtra...、题目为addition 1。</p>
                </div>
                <div id="main3" style="width: 100%;height:400px;"></div>
            </div>
            <br><br>

            <div id="exercise_master_level">
                <span style="font-size: 18px">练习掌握度</span>
                <button id="btn5" type="button" class="btn btn-outline-info" value="点击显示"
                        style="margin-right: 10px;margin-left: 1000px">说明
                </button>
                <div id="explanation5" style="width: 300px;margin-left: 700px;position:absolute;right:20px;"
                     class="border-explanation hide">
                    <p style="margin: 5px 8px">
                        说明：从下图可以看出，学生对题目的掌握度总体达到了85%，说明练习效果较好。</p>
                </div>
                <div id="exercise_master_percentage" style="width: 100%;height:400px;"></div>
            </div>
            <br><br>

        </section>

    </div>

</section><!-- End Our Team Section -->

<!-- ======= Footer ======= -->
<footer id="footer">
    <div class="container">
        <div class="copyright">
            &copy; Copyright <strong><span>Mamba</span></strong>. All Rights Reserved
        </div>
        <div class="credits">
            <!-- All the links in the footer should remain intact. -->
            <!-- You can delete the links only if you purchased the pro version. -->
            <!-- Licensing information: https://bootstrapmade.com/license/ -->
            <!-- Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/mamba-one-page-bootstrap-template-free/ -->
            Designed by <a href="https://bootstrapmade.com/">BootstrapMade</a>
        </div>
    </div>
</footer><!-- End Footer -->

<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

<!-- Vendor JS Files -->
<script src="static/assets/vendor/jquery/jquery.min.js"></script>
<script src="static/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="static/assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="static/assets/vendor/php-email-form/validate.js"></script>
<script src="static/assets/vendor/jquery-sticky/jquery.sticky.js"></script>
<script src="static/assets/vendor/venobox/venobox.min.js"></script>
<script src="static/assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="static/assets/vendor/counterup/counterup.min.js"></script>
<script src="static/assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="static/assets/vendor/aos/aos.js"></script>

<!-- Template Main JS File -->
<script src="static/assets/js/main.js"></script>

<script type="text/javascript">

    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    var myChart2 = echarts.init(document.getElementById('main2'));
    var myChart3 = echarts.init(document.getElementById('main3'));
    var myChart4 = echarts.init(document.getElementById('exercise_master_percentage'));
    var myChart5 = echarts.init(document.getElementById('main5'));

    // 指定图表的配置项和数据
    var option = {
        color: ['#636EFA'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                name: '学号',
                type: 'category',
                data: {{ ids|tojson }},
                {#[1105, 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],#}
                axisTick: {
                    alignWithLabel: true
                },

            }
        ],
        yAxis: [
            {
                name: '数量',
                type: 'value'
            }
        ],
        series: [
            {
                name: '做题数量',
                type: 'bar',
                barWidth: '60%',
                data: {{ nums|tojson }},
                {#[100, 52, 200, 334, 390, 330, 220]#}
            }
        ]
    };
    const dataAll = [{{ num_points|tojson }}]
    const markLineOpt = {
        animation: false,
        data: [
            [
                {
                    coord: [0, 3],
                    symbol: 'none'
                },
                {
                    coord: [20, 13],
                    symbol: 'none'
                }
            ]
        ]
    };
    var option2 = {
        color: ['#636EFA'],
        title: {
            text: " 获得积分与做题数量的关系 ",
            left: 'center',
            top: 0
        },
        grid: [
            {left: '7%', top: '7%', width: '80%', height: '80%'}
        ],
        tooltip: {
            formatter: '({c})'
        },
        xAxis: [
            {
                name: '做题数量',
                gridIndex: 0, min: 0, max: {{num_max}}
            }
        ],
        yAxis: [
            {
                name: '获得积分',
                gridIndex: 0, min: 0, max: {{points_max}}
            }
        ],
        series: [
            {
                name: 'I',
                type: 'scatter',
                xAxisIndex: 0,
                yAxisIndex: 0,
                data: dataAll[0],
                markLine: markLineOpt
            }
        ]
    };

    const dataAll5 = [{{ num_rate|tojson }}]
    const markLineOpt5 = {
        animation: false,
        data: [
            [
                {
                    coord: [0, 3],
                    symbol: 'none'
                },
                {
                    coord: [20, 13],
                    symbol: 'none'
                }
            ]
        ]
    };
    var option5 = {
        color: ['#057D0B'],
        title: {
            text: " 正确率与做题数量的关系 ",
            left: 'center',
            top: 0
        },
        grid: [
            {left: '7%', top: '7%', width: '80%', height: '80%'}
        ],
        tooltip: {
            formatter: '({c})'
        },
        xAxis: [
            {
                name: '做题数量',
                gridIndex: 0, min: 0, max: {{num_max}}
            }
        ],
        yAxis: [
            {
                name: '正确率',
                gridIndex: 0, min: 0, max: 1
            }
        ],
        series: [
            {
                name: 'I',
                type: 'scatter',
                xAxisIndex: 0,
                yAxisIndex: 0,
                data: dataAll5[0],
                markLine: markLineOpt5
            }
        ]
    };

    const data =
    {{ list_area|safe }}
    const data2 =
    {{ list_topic|safe }}
    const data3 = {{ list_exercise_name|safe }}
        option3 = {
            color: [
                '#ca8622',
                '#61a0a8',
                '#d48265',
                '#91c7ae',
                '#749f83',
                '#bda29a',
                '#6e7074',
                '#546570',
                '#c4ccd3'],
            title: [
                {
                    text: '最受学生喜欢的题目类型',
                    left: 'center'
                },
                {
                    subtext: '热门领域',
                    left: '16.67%',
                    top: '75%',
                    textAlign: 'center'
                },
                {
                    subtext: '热门话题',
                    left: '50%',
                    top: '75%',
                    textAlign: 'center'
                },
                {
                    subtext: '热门题目',
                    left: '83.33%',
                    top: '75%',
                    textAlign: 'center'
                }
            ],
            series: [
                {
                    type: 'pie',
                    radius: '25%',
                    center: ['50%', '50%'],
                    data: data,
                    label: {
                        position: 'outer',
                        alignTo: 'none',
                        bleedMargin: 5
                    },
                    left: 0,
                    right: '66.6667%',
                    top: 0,
                    bottom: 0
                },
                {
                    type: 'pie',
                    radius: '25%',
                    center: ['50%', '50%'],
                    data: data2,
                    label: {
                        position: 'outer',
                        alignTo: 'labelLine',
                        bleedMargin: 5
                    },
                    left: '33.3333%',
                    right: '33.3333%',
                    top: 0,
                    bottom: 0
                },
                {
                    type: 'pie',
                    radius: '25%',
                    center: ['50%', '50%'],
                    data: data3,
                    label: {
                        position: 'outer',
                        alignTo: 'edge',
                        margin: 20
                    },
                    left: '66.6667%',
                    right: 0,
                    top: 0,
                    bottom: 0
                }
            ]
        };
    option4 = {
        color: [
            '#ca8622',
            '#61a0a8'],
        title: {
            subtext: 'Percent of mastered exercises',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: 'Percent of mastered exercises',
                type: 'pie',
                radius: '50%',
                data:{{ master_percentage|tojson }},
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
    myChart2.setOption(option2);
    myChart3.setOption(option3);
    myChart4.setOption(option4);
    myChart5.setOption(option5);
</script>

<script>
    var btn1 = document.getElementById("btn1");
    var btn2 = document.getElementById("btn2");
    var btn3 = document.getElementById("btn3");
    var btn4 = document.getElementById("btn4");
    var btn5 = document.getElementById("btn5");
    var btn2_2 = document.getElementById("btn2-2");
    var btn3_2 = document.getElementById("btn3-2");
    var explanation1 = document.getElementById("explanation1");
    var explanation2 = document.getElementById("explanation2");
    var explanation3 = document.getElementById("explanation3");
    var explanation4 = document.getElementById("explanation4");
    var explanation5 = document.getElementById("explanation5");
    var explanation2_2 = document.getElementById("explanation2-2");
    var explanation3_2 = document.getElementById("explanation3-2");

    btn1.onclick = function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn1.value === "点击隐藏") {
            explanation1.classList.add("hide");
            btn1.value = "点击显示";
        } else {
            explanation1.classList.remove("hide");
            btn1.value = "点击隐藏";
        }
    };


    btn2.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn2.value === "点击隐藏") {
            explanation2.classList.add("hide");
            btn2.value = "点击显示";
        } else {
            explanation2.classList.remove("hide");
            btn2.value = "点击隐藏";
        }
    }, false);

    btn3.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn3.value === "点击隐藏") {
            explanation3.classList.add("hide");
            btn3.value = "点击显示";
        } else {
            explanation3.classList.remove("hide");
            btn3.value = "点击隐藏";
        }
    }, false);

    btn4.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn4.value === "点击隐藏") {
            explanation4.classList.add("hide");
            btn4.value = "点击显示";
        } else {
            explanation4.classList.remove("hide");
            btn4.value = "点击隐藏";
        }
    }, false);

    btn5.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn5.value === "点击隐藏") {
            explanation5.classList.add("hide");
            btn5.value = "点击显示";
        } else {
            explanation5.classList.remove("hide");
            btn5.value = "点击隐藏";
        }
    }, false);

    btn2_2.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn2_2.value === "点击隐藏") {
            explanation2_2.classList.add("hide");
            btn2_2.value = "点击显示";
        } else {
            explanation2_2.classList.remove("hide");
            btn2_2.value = "点击隐藏";
        }
    }, false);

    btn3_2.addEventListener('click', function () {
        //如果元素div当前是显示的, 就让他隐藏
        if (btn3_2.value === "点击隐藏") {
            explanation3_2.classList.add("hide");
            btn3_2.value = "点击显示";
        } else {
            explanation3_2.classList.remove("hide");
            btn3_2.value = "点击隐藏";
        }
    }, false);

</script>
</body>

</html>